import xhr from '@http/http'

// 获取所有校区
export const _getCampus = () => xhr(`./api/common/listSchoolArea`, {
  method: 'GET'
})
// 根据校区查园区
export const _getArea = (id) => xhr(`./api/common/listCampusBySchoolAreaId/${id}`, {
  method: 'GET'
})
// 学院/辅导员用户查询可以管理的楼栋
export const _collegeListBuilding = () => xhr(`./api/common/collegeListBuilding`, {
  method: 'GET'
})

// 根据房间id查询房间内床位
export const _listBedByRoomId = (id) => xhr(`./api/common/listBedByRoomId/${id}`)

// 根据园区id查询下面的楼栋
export const _listBuildingByCampusId = (id) => xhr(`./api/common/listBuildingByCampusId/${id}`, {
  method: 'GET'
})

// // 根据园区id和登陆用户查询管辖的楼栋
// export const _listBuildingByCampusIdAndUser GET ./api/common/listBuildingByCampusIdAndUser/${id}

// // 根据校区id查询下面的园区
// export const _listCampusBySchoolAreaId GET ./api/common/listCampusBySchoolAreaId/${id}

// // 根据登陆用户查询指定校区下的园区
// export const _listCampusBySchoolAreaIdAndUser GET ./api/common/listCampusBySchoolAreaIdAndUser/${id}

// // 根据房间id查询房间内可用的床位
// export const _listCanUseBedByRoomId GET ./api/common/listCanUseBedByRoomId/${id}

// // 查询指定组织机构下和指定年级下的班级信息
// export const _listClassByGradeAndMajorId GET ./api/common/listClassByGradeAndMajorId/${grade}/${majorId}

// 件查询班级// 根据条
// export const _listClassInfoByCondition POST ./api/common/listClassInfoByCondition

// // 根据登陆用户查询学院列表
// export const _listCollegeByUser GET ./api/common/listCollegeByUser
// 根据楼栋id查询下面的楼层
export const _listFloorByBuildingId = (id) => xhr(`./api/common/listFloorByBuildingId/${id}`, {
  method: 'GET'
})

// 根据专业id查询年级列表
export const _listGradeByMajorId = (majorId) => xhr(`./api/common/listGradeByMajorId/${majorId}`, {
  method: 'GET'
})

// 根据学院查询学院下的专业列表
export const _listMajorByCollegeId = (collegeId) => xhr(`./api/common/listMajorByCollegeId/${collegeId}`, {
  method: 'GET'
})

// 根据登陆用户查询专业列表
export const _listMajorByUser = () => xhr(`./api/common/listMajorByUser`, {
  method: 'GET'
})

// 根据楼栋id查询管辖的房间
export const _listRoomByBuildingId = (id) => xhr(`./api/common/listRoomByBuildingId/${id}`, {
  method: 'GET'
})

// 根据楼栋id和登陆用户查询管辖的还有床位的房间
export const _listRoomByBuildingIdAndUser = (id) => xhr(`./api/common/listRoomByBuildingIdAndUser/${id}`, {
  method: 'GET'
})

// 查询所有校区
export const _listSchoolArea = () => xhr(`./api/common/listSchoolArea`, {
  method: 'GET'
})

// 用户根据登陆用户查询可以查看的校区
export const _listSchoolAreaByUser = () => xhr(`./api/common/listSchoolAreaByUser`, {
  method: 'GET'
})

// 根据条件和登陆用户分页查询管辖的还有床位的房间信息
export const _pageRoomByBuildingIdAndUser = (body) => xhr(`./api/common/pageRoomByBuildingIdAndUser`, {
  method: 'POST',
  body
})

// 根据条件和登陆用户分页查询学生列表
export const _pageStudentByCondition = (body) => xhr(`./api/common/pageStudentByCondition`, {
  method: 'POST',
  body
})
// 获取所有年级
export const _listAllGrade = () => xhr(`./api/common/listAllGrade`, {
  method: 'GET'
})
// 下载模板
export const downTempletUsingGET = (params) => xhr(`./api/bedroomRating/ratingList/templet`, {
  method: 'get',
  responseType: 'blob',
  params
})
